/******************************************************************************
 * @file     pc_test_runtime.c
 * @version  V0.10
 * $Revision: 1 $
 * $Date: 21/02/23 9:23a $
 * @brief    IEC60730 Program Counter Test
 * @note
 * SPDX-License-Identifier: Apache-2.0
 * Copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.
 ******************************************************************************/

#include <stdio.h>
#include "nuc980.h"
#include "IEC60730_CONTROL_PARAM.h"
#include "IEC60730_SAFETY_TEST_LIB.h"

#ifdef __ICCARM__
#pragma optimize=none
#endif

#ifdef __ARMCC_VERSION
#pragma O0
#endif

extern uint32_t pc_test_return1(void);
extern uint32_t pc_test_return2(void);

uint8_t IEC60730_PC_Test_RunTime(void)
{
    uint8_t u8PCTestPass;
    uint32_t u32Addr = (uint32_t)&pc_test_return2;

    u8PCTestPass = TEST_PASS;
    if(pc_test_return1() != PC_RETURNVALUE)
        u8PCTestPass = TEST_FAIL;

    if(pc_test_return2() != u32Addr)
        u8PCTestPass = TEST_FAIL;

    return u8PCTestPass;
}

/*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
